<?php echo $this->Form->create('Empleados', array('action' => 'empleados')); ?>
<div class="widget">
    <div class="whead"><h6>LISTADO DE EMPLEADOS</h6><div class="clear"></div></div>
    <div class="shownpars">
        <table cellpadding="0" cellspacing="0" border="0" class="dTable">
            <thead>
                <tr>
                    <th>Nro</th>
                    <th>Nombre</th>
                    <th>Tel&eacute;fono</th>
                    <th>Direcci&oacute;n</th>
                    <th>Tipo Empleado</th>
                    <th>Estado</th>
                    <th>Acciones</th>
                </tr>
            </thead>
            <tbody>
                <?php $i = 1; ?>
                <?php foreach ($empleados as $emp): ?>  
                <?php $estado = ($emp['Empleado']['estado'] == 1) ? "activo" : "inactivo"; ?>
                <?php $clasestado = ($emp['Empleado']['estado'] == 1)? "class=tag" : "class=high";?>              
                <tr <?php echo fmod($i, 2) ? "class = bg" : "";?>>
                    <td><?php echo $i;$i++; ?></td>
                    <td><?php echo $emp['Empleado']['nombre']; ?></td>
                    
                    
                    <td><?php echo $emp['Empleado']['telefono']; ?></td>
                    <td><?php echo $emp['Empleado']['direccion']; ?></td>
                    <td><?php echo $emp['Empleado']['tipoempleado_id']; ?></td>
                    <td><?php echo $emp['Empleado']['estado']; ?></td>
                    <td>
                        <?php echo $this->Html->link($this->Html->image("iconos/edit.png", array("alt" =>'Editar', 'title' => 'Editar')), array('action' => 'editar', $emp['Empleado']['id']),array('escape' => false)); ?>
                        <?php //echo $this->Html->link($this->Html->image('edit.png', array("alt" => 'Editar', 'title' => 'editar')), array('action' => 'editar', $emp['Empleado']['id']), array('escape' => false)); ?>&nbsp;
                        <?php if($estado == "activo"):?>
                        <?php echo $this->Html->link($this->Html->image('iconos/baja.png', array("alt" => 'dar baja', 'title' => 'dar de baja')), array('action' => 'baja', $emp['Empleado']['id']), array('escape' => false)); ?>&nbsp;
                        <?php else:?>
                        <?php echo $this->Html->link($this->Html->image('iconos/alta.png', array("alt" => 'dar alta', 'title' => 'dar de alta')), array('action' => 'alta', $emp['Empleado']['id']), array('escape' => false)); ?>&nbsp;
                        <?php endif;?>
                        <?php //echo $this->Html->link('ELIMINAR',array('action'=>'eliminar',$emp['Empleado']['id']),array('class' => 'inner_a'),('Desea realmente eliminar?')); ?>
                        <?php echo $this->Html->link($this->Html->image("iconos/elim.png", array("alt" =>'Eliminar', 'title' => 'Eliminar')), array('action' => 'eliminar', $emp['Empleado']['id']),array('escape' => false), 
                        ("Desea eliminar realmente??")); ?>
                    </td>
                </tr>
                <?php endforeach; ?>                
            </tbody>
        </table>
    </div> 
</div> 


  